home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_400
/
443_01
/
doc
/
info
/
cncl.info-3
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
GNU Info File
|
1996-01-04
|
49.3 KB
|
1,958 lines
This is Info file cncl.info, produced by Makeinfo-1.63 from the input
file cncl.texi.
This file documents the use of CNCL, the Communication Networks Class
Library.
Copyright (C) 1993-1996, Communication Networks.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that the
entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
Permission is granted to copy and distribute translations of this
manual into other languages, under the above conditions for modified
versions.
File: cncl.info, Node: CNSLList, Next: CNSLObject, Prev: CNAVLNode, Up: Container
CNSLList -- Single Linked List of Objects
=========================================
SYNOPSIS
--------
`#include <CNCL/SLList.h>'
TYPE
----
`CN_SLLIST'
* Menu:
BASE CLASSES
------------
* CNObject:: Root of the CNCL Hierarchy
DERIVED CLASSES
---------------
* CNDLList:: Doubly Linked List of Objects
RELATED CLASSES
---------------
* CNSLObject:: Node of Single Linked List
* CNSLIterator:: Iterator of Single Linked List
DESCRIPTION
-----------
`CNSLList' is a single linked list that can contain any CNCL
compatible object.
Constructors:
`CNSLList();'
`CNSLList(CNParam *param);'
Initializes the list to empty state.
Please note, that there is NO copy constructor supplied. Any
attempt to copy a CNSLList will yield a fatal error.
Destructors:
`~CNSLList();'
Deletes the linked list and all `CNSLObject' nodes. It does NOT
delete the objects referenced by the nodes.
In addition to the member functions required by CNCL, `CNSLList'
provides:
`CNSLObject *first() const;'
Returns the first node in the list or `NIL' if the list is empty.
`virtual CNSLObject *last() const;'
Returns the last node in the list or `NIL' if the list is empty.
`CNSLObject *next(CNSLObject *link) const;'
Returns the next node in the list, where `link' points to the
current node. This may be `NIL' if the next node doesn't exist.
`virtual CNSLObject *prev(CNSLObject *link) const;'
Returns the previous node in the list, where `link' points to the
current node. This may be `NIL' if the previous node doesn't exist.
`bool empty() const;'
Checks if `DLList' is empty.
`unsigned long length() const;'
Returns the length (number of nodes) of this `DLList'.
`virtual CNSLObject *append(CNObject *obj);'
`virtual CNSLObject *append(CNObject &obj);'
Adds a new node to the end of the list, referencing the object
`obj'. It returns the node allocated for the object.
`virtual CNSLObject *append(CNSLObject *obj);'
Adds an already allocated node to the list. It returns the pointer
`obj'.
`virtual CNSLObject *prepend(CNObject *obj);'
`virtual CNSLObject *prepend(CNObject &obj);'
Adds a new node to the start of the list, referencing the object
`obj'. It returns the node allocated for the object.
`virtual CNSLObject *prepend(CNSLObject *obj);'
Adds an already allocated node to the list. It returns the pointer
`obj'.
`virtual CNSLObject *delete_object(CNSLObject *pos);'
Deletes the node `pos' from the list. It returns the next node.
This function deletes the node (`CNSLObject') from the list, but
it does NOT delete the object referenced by the node.
`virtual CNSLObject *remove_object(CNSLObject *pos);'
Removes the node `pos' from the list. It returns the next node.
This function does NOT delete the linked list node (`CNSLObject')
and it does NOT delete the object referenced by the node, either.
`void delete_all();'
Deletes all nodes from the linked list and initializes the list to
empty. The objects referenced by the nodes are NOT deleted.
`void delete_all_w_obj();'
Deletes all nodes from the linked list, initializes the list to
empty, AND deletes the referenced objects.
`virtual CNSLObject *insert_before(CNSLObject *pos, CNObject *obj);'
`virtual CNSLObject *insert_before(CNSLObject *pos, CNObject &obj);'
Creates a new node for `obj' and inserts it into the list before
node `pos'. It returns the new node.
`virtual CNSLObject *insert_before(CNSLObject *pos, CNSLObject *obj);'
Inserts an already allocated node into the list before node `pos'.
It returns `obj'.
`virtual CNSLObject *insert_after(CNSLObject *pos, CNObject *obj);'
`virtual CNSLObject *insert_after(CNSLObject *pos, CNObject &obj);'
Creates a new node for `obj' and inserts it into the list after
node `pos'. It returns the new node.
`virtual CNSLObject *insert_after(CNSLObject *pos, CNSLObject *obj);'
Inserts an already allocated node into the list after node `pos'.
It returns `obj'.
File: cncl.info, Node: CNSLObject, Next: CNSLIterator, Prev: CNSLList, Up: Container
CNSLObject -- Node of Single Linked List
========================================
SYNOPSIS
--------
`#include <CNCL/SLObject.h>'
TYPE
----
`CN_SLOBJECT'
* Menu:
BASE CLASSES
------------
* CNObject:: Root of the CNCL hierarchy
DERIVED CLASSES
---------------
* CNDLObject:: Node of Doubly Linked List
RELATED CLASSES
---------------
* CNSLList:: Single Linked List of Objects
* CNSLIterator:: Iterator of Single Linked List
DESCRIPTION
-----------
`CNSLObject' is a node in the `CNSLList' single linked list. It
contains a pointer to the next and a pointer to the referenced object.
Constructors:
`CNSLObject();'
`CNSLObject(CNParam *param);'
`CNSLObject(CNObject *obj);'
Initializes `CNSLObject' and optionally sets a referenced object.
`CNSLObject's have a private destructor and can therefore only be
allocated on the heap. Furthermore `CNSLObject's cannot be copied, no
copy constructor is supplied; an attempt to do so results in a runtime
error.
In addition to the member functions required by CNCL, `CNSLObject'
provides:
`CNSLObject *set_next(CNSLObject *p);'
`CNSLObject *next(CNSLObject *p);'
`CNSLObject *get_next();'
`CNSLObject *next();'
Sets/gets the pointer to the next node. It returns the current
pointer.
`CNObject *object(CNObject *obj);'
`CNObject *object();'
`CNObject *set_object(CNObject *obj);'
`CNObject *get_object();'
Gets/sets the pointer to the referenced object. It returns the
current value.
`void delete_object();'
Deletes the referenced object.
File: cncl.info, Node: CNSLIterator, Next: CNDLList, Prev: CNSLObject, Up: Container
CNSLIterator -- Iterator of Single Linked List
==============================================
SYNOPSIS
--------
`#include <CNCL/SLIterator.h>'
TYPE
----
`CN_SLITERATOR'
* Menu:
BASE CLASSES
------------
* CNObject:: Root of the CNCL Hierarchy
DERIVED CLASSES
---------------
* CNDLIterator:: Iterator of Doubly Linked List
RELATED CLASSES
---------------
* CNSLList:: Single Linked List of Objects
* CNSLObject:: Node of Single Linked List
DESCRIPTION
-----------
`CNSLIterator' is an iterator to traverse a `CNSLList' single linked
list.
Constructors:
`CNSLIterator();'
`CNSLIterator(CNParam *param);'
Initializes `CNSLIterator'.
`CNSLIterator(const CNSLList *new_list);'
`CNSLIterator(const CNSLList &new_list);'
Initializes `CNSLIterator' with linked list `list'. The iterator
is reset to the first element in the list.
In addition to the member functions required by CNCL, `CNSLIterator'
provides:
`void reset(const CNSLList *new_list);'
`void reset(const CNSLList &new_list);'
`void reset();'
Resets the iterator to a new list `new_list' and/or sets the
iterator to the first element in the list.
`CNObject *object()'
`CNObject *get_object()'
Gets the referenced object from the current iterator position. It
returns the object or `NIL', if none is available.
`CNSLObject *position()'
`CNSLObject *get_position()'
Gets the current iterator position (node in the list). It returns a
pointer to the node or `NIL', if none is available.
`CNObject *first_object();'
`CNObject *first();'
Sets the iterator to the first element in the list. It returns the
referenced object or `NIL', if none is available.
`CNObject *last_object();'
`CNObject *last();'
Sets the iterator to the last element in the list. It returns the
referenced object or `NIL', if none is available.
`CNObject *next_object();'
`CNObject *next();'
`CNObject *operator ++();'
`CNObject *operator ++(int);'
Moves the iterator to the next element in the list. It returns the
current referenced object (the one BEFORE moving the iterator) or
`NIL', if none is available.
An example which shows the use of a `Iterators' object to traverse a
double linked list can be found at the end of the class `CNDIterator'.
File: cncl.info, Node: CNDLList, Next: CNDLObject, Prev: CNSLIterator, Up: Container
CNDLList -- Doubly Linked List of Objects
=========================================
SYNOPSIS
--------
`#include <CNCL/DLList.h>'
TYPE
----
`CN_DLLIST'
* Menu:
BASE CLASSES
------------
* CNSLList:: Single Linked List
DERIVED CLASSES
---------------
RELATED CLASSES
---------------
* CNDLObject:: Node of Doubly Linked List
* CNDLIterator:: Iterator of Doubly Linked List
DESCRIPTION
-----------
`CNDLList' is a doubly linked list that can contain any CNCL
compatible object.
Constructors:
`CNDLList();'
`CNDLList(CNParam *param);'
Initializes the list to empty state.
Please note, that there is NO copy constructor supplied. Any
attempt to copy a CNDLList will yield a fatal error.
Destructors:
`~CNDLList();'
Deletes the linked list and all `CNDLObject' nodes. It does NOT
delete the objects referenced by the nodes.
In addition to the member functions required by CNCL and to the
functions supplied by `CNSLList', `CNDLList' provides or defines more
efficiently:
`CNDLObject *last() const;'
Returns the last node in the list or `NIL' if the list is empty.
`CNDLObject *prev(CNDLObject *link) const;'
Returns the previous node in the list, where `link' points to the
current node. This may be `NIL' if the previous node doesn't exist.
`CNDLObject *append(CNObject *obj);'
`CNDLObject *append(CNObject &obj);'
Adds a new node to the end of the list, referencing the object
`obj'. It returns the node allocated for the object.
`CNDLObject *append(CNDLObject *obj);'
Adds an already allocated node to the list. It returns the pointer
`obj'.
`CNDLObject *insert_before(CNDLObject *pos, CNObject *obj);'
`CNDLObject *insert_before(CNDLObject *pos, CNObject &obj);'
Creates a new node for `obj' and inserts it into the list before
node `pos'. It returns the new node.
`CNDLObject *insert_before(CNDLObject *pos, CNDLObject *obj);'
Inserts an already allocated node into the list before node `pos'.
It returns `obj'.
`bool ok();'
Checks the list for consistency. It returns `TRUE', if the list is
o.k.
File: cncl.info, Node: CNDLObject, Next: CNDLIterator, Prev: CNDLList, Up: Container
CNDLObject -- Node of Doubly Linked List
========================================
SYNOPSIS
--------
`#include <CNCL/DLObject.h>'
TYPE
----
`CN_DLOBJECT'
* Menu:
BASE CLASSES
------------
* CNSLObject:: Node of Single Linked List
DERIVED CLASSES
---------------
RELATED CLASSES
---------------
* CNDLList:: Doubly Linked List of Objects
* CNDLIterator:: Iterator of Doubly Linked List
DESCRIPTION
-----------
`CNDLObject' is a node in the `CNDLList' doubly linked list. In
addition to the base class it contains a pointer to the previous node.
Constructors:
`CNDLObject();'
`CNDLObject(CNParam *param);'
`CNDLObject(CNObject *obj);'
Initializes `CNDLObject' and optionally sets a referenced object.
`CNDLObject's have a private destructor and can therefore only be
allocated on the heap. Furthermore `CNDLObject's cannot be copied, no
copy constructor is supplied; an attempt do so results in a runtime
error.
In addition to the member functions required by CNCL and to the
functions declared at `CNSLObject', `CNDLObject' provides:
`CNDLObject *prev(CNDLObject *p);'
`CNDLObject *prev();'
`CNDLObject *set_prev(CNDLObject *p);'
`CNDLObject *get_prev();'
Gets/sets the pointer to the previous node. It returns the current
pointer.
File: cncl.info, Node: CNDLIterator, Next: CNQueue, Prev: CNDLObject, Up: Container
CNDLIterator -- Iterator of Doubly Linked List
==============================================
SYNOPSIS
--------
`#include <CNCL/DLIterator.h>'
TYPE
----
`CN_DLITERATOR'
* Menu:
BASE CLASSES
------------
* CNSLIterator:: Iterator of Single Linked List
DERIVED CLASSES
---------------
RELATED CLASSES
---------------
* CNDLList:: Doubly Linked List of Objects
* CNDLObject:: Node of Doubly Linked List
DESCRIPTION
-----------
`CNDLIterator' is an iterator to traverse a `CNDLList' doubly linked
list.
Constructors:
`CNDLIterator();'
`CNDLIterator(CNParam *param);'
Initializes `CNDLIterator'.
`CNDLIterator(const CNDLList *new_list);'
`CNDLIterator(const CNDLList &new_list);'
Initializes `CNDLIterator' with linked list `list'. The iterator
is reset to the first element in the list.
In addition to the member functions required by CNCL, `CNDLIterator'
provides or defines more efficiently:
`void reset(const CNDLList *new_list);'
`void reset(const CNDLList &new_list);'
`void reset();'
Resets the iterator to a new list `new_list' and/or sets the
iterator to the first element in the list.
`CNDLObject *position()'
`CNDLObject *get_position()'
Gets the current iterator position (node in the list). It returns a
pointer to the node or `NIL', if none is available.
`CNObject *last_object();'
`CNObject *last();'
Sets the iterator to the last element in the list. It returns the
referenced object or `NIL', if none is available.
`CNObject *prev_object();'
`CNObject *prev();'
`CNObject *operator --();'
`CNObject *operator --(int);'
Moves the iterator to the previous element in the list. It returns
the current referenced object (the one BEFORE moving the iterator)
or `NIL', if none is available.
The following examples show how to use a `CNDLIterator' object to
traverse a linked list:
Forward:
CNDLList list;
...
CNDLIterator trav(list);
CNObject *obj;
while(obj = trav++)
{
// Do something with obj ...
}
Alternate forward:
for(trav.reset(list); obj=trav.object(); trav.next())
{
// ...
}
Backward:
for(trav.last(); obj=trav.object(); trav--)
{
// ...
}
File: cncl.info, Node: CNQueue, Next: CNQueueFIFO, Prev: CNDLIterator, Up: Container
CNQueue -- Abstract Queue Base Class
====================================
SYNOPSIS
--------
`#include <CNCL/Queue.h>'
TYPE
----
`CN_QUEUE'
* Menu:
BASE CLASSES
------------
* CNObject:: Root of the CNCL Hierarchy
DERIVED CLASSES
---------------
* CNQueueFIFO:: FIFO Queue
* CNQueueLIFO:: LIFO Queue
* CNQueueRandom:: Random Queue
* CNQueueSPT:: SPT Queuecontainer
* CNPrioQueueFIFO:: Priority Queue
* CNSink:: Sink
RELATED CLASSES
---------------
* CNJob:: Standard Job for Queues
* CNStack:: Stack
DESCRIPTION
-----------
`CNQueue' is a queue of any CNCL compatible object.
Constructors:
`CNQueue();'
`CNQueue(CNParam *param);'
Initialize the queue.
In addition to the member functions required by CNCL, `CNQueue'
provides the following abstract member function, which must be
implemented by the derived classes:
`virtual bool empty() const = 0;'
Returns `TRUE', if the queue is empty.
`virtual bool full() const = 0;'
Returns `TRUE', if the queue is full.
`virtual int length() const = 0;'
Returns the actual queue length.
`virtual void put(CNObject *obj) = 0;'
`void put(CNObject &obj);'
Puts an object into the queue.
`virtual CNObject *get() = 0;'
Retrieves an object from the queue.
`virtual CNObject *peek() = 0;'
Retrieves an object from the queue. Unlike `get()', the object is
not removed from the queue.
`virtual void delete_all() = 0;'
Deletes all objects in the queue.
File: cncl.info, Node: CNQueueFIFO, Next: CNQueueLIFO, Prev: CNQueue, Up: Container
CNQueueFIFO -- FIFO Queue
=========================
SYNOPSIS
--------
`#include<CNCL/QueueFIFO.h>'
TYPE
----
`CN_QUEUEFIFO'
* Menu:
BASE CLASSES
------------
* CNQueue:: Abstract Queue Base Class
DERIVED CLASSES
---------------
RELATED CLASSES
---------------
* CNDLList:: Doubly Linked List of Objects
* CNQueueLIFO:: LIFO Queue
* CNQueueRandom:: Random Queue
* CNQueueSPT:: SPT Queuecontainer
* CNPrioQueueFIFO:: Priority Queue
* CNSink:: Sink
* CNJob:: Standard Job for Queues
* CNStack:: Stack
DESCIPTION
----------
`CNQueueFIFO' is a queue, implemented as a doubly linked list, that
can contain any number (well, sort of ... ;-) CNCL compatible objects.
The queueing strategy is FIFO (First In, First Out).
Constructors:
`CNQueueFIFO();'
`CNQueueFIFO(CNParam *param);'
Initialize the FIFO-queue to an empty state.
In addition to the member functions required by CNCL, `CNQueueFIFO'
provides:
`virtual bool empty() const;'
Returns `TRUE', if the queue is empty.
`virtual bool full() const;'
Always returns `TRUE'.
`virtual int length() const;'
Returns the actual queue length.
`virtual void put(CNObject *obj);'
Puts an object into the queue.
`virtual CNObject *get();'
Retrieves an object from the queue.
`virtual CNObject *peek();'
Retrieves an object from the queue. Unlike `get()', the object is
not removed from the queue.
`virtual void delete_all();'
Deletes all objects in the queue.
File: cncl.info, Node: CNQueueLIFO, Next: CNQueueRandom, Prev: CNQueueFIFO, Up: Container
CNQueueLIFO -- LIFO queue
=========================
SYNOPSIS
--------
`#include <CNCL/QueueLIFO.h>'
TYPE
----
`CN_QUEUELIFO'
* Menu:
BASE CLASSES
------------
* CNQueue:: Abstract queue base class
DERIVED CLASSES
---------------
RELATED CLASSES
---------------
* CNDLList:: Doubly Linked List of Objects
* CNQueueFIFO:: FIFO Queue
* CNQueueRandom:: Random Queue
* CNQueueSPT:: SPT Queuecontainer
* CNPrioQueueFIFO:: Priority Queue
* CNSink:: Sink
* CNJob:: Standard Job for Queues
* CNStack:: Stack
DESCRIPTION
-----------
`CNQueueLIFO' is a queue, implemented as a doubly linked list, that
can contain any number (well, sort of ... ;-) CNCL compatible objects.
The queueing strategy is LIFO (Last In, First Out).
Constructors:
`CNQueueLIFO();'
`CNQueueLIFO(CNParam *param);'
Initialize the LIFO-queue to an empty state.
In addition to the member functions required by CNCL, `CNQueueLIFO'
provides:
`virtual bool empty() const;'
Returns `TRUE', if the queue is empty.
`virtual bool full() const;'
Always returns `FALSE'.
`virtual int length() const;'
Returns the actual queue length.
`virtual void put(CNObject *obj);'
Puts an object into the queue.
`virtual CNObject *get();'
Retrieves an object from the queue.
`virtual CNObject *peek();'
Retrieves an object from the queue. Unlike `get()', the object is
not removed from the queue.
`virtual void delete_all();'
Deletes all objects in the queue.
File: cncl.info, Node: CNQueueRandom, Next: CNQueueSPT, Prev: CNQueueLIFO, Up: Container
CNQueueRandom -- Random queue
=============================
SYNOPSIS
--------
`#include <CNCL/QueueRandom.h>'
TYPE
----
`CN_QUEUERANDOM'
* Menu:
BASE CLASSES
------------
* CNQueue:: Abstract queue base class
DERIVED CLASSES
---------------
RELATED CLASSES
---------------
* CNDLList:: Doubly Linked List of Objects
* CNQueueFIFO:: FIFO queue
* CNQueueLIFO:: LIFO queue
* CNQueueSPT:: SPT Queuecontainer
* CNPrioQueueFIFO:: Priority Queue
* CNSink:: Sink
* CNJob:: Standard Job for Queues
* CNStack:: Stack
DESCRIPTION
-----------
`CNQueueRandom' is a queue, implemented as a doubly linked list, that
can contain any number (well, sort of ... ;-) CNCL compatible objects.
The queueing strategy is Random, that means there is no ordering in the
queue.
Constructors:
`CNQueueRandom();'
`CNQueueRandom(CNParam *param);'
`CNQueueRandom(CNRNG *rng);'
Initialize the Random-queue to an empty state. One may provide a
base random number generator (recommended!), otherwise the queue
provides its own (default setting: `CNFiboG'.)
In addition to the member functions required by CNCL, `CNQueueRandom'
provides:
`virtual bool empty() const;'
Returns `TRUE', if the queue is empty.
`virtual bool full() const;'
Always returns `FALSE'.
`virtual int length() const;'
Returns the actual queue length.
`virtual void put(CNObject *obj);'
Puts an object into the queue.
`virtual CNObject *get();'
Retrieves a random object from the queue.
`virtual CNObject *peek();'
Retrieves an object from the queue. Unlike `get()', the object is
not removed from the queue.
`virtual void delete_all();'
Deletes all objects in the queue.
File: cncl.info, Node: CNQueueSPT, Next: CNPrioQueueFIFO, Prev: CNQueueRandom, Up: Container
CNQueueSPT -- SPT queue
=======================
SYNOPSIS
--------
`#include <CNCL/QueueSPT.h>'
TYPE
----
`CN_QUEUESPT'
* Menu:
BASE CLASSES
------------
* CNQueue:: Abstract queue base class
DERIVED CLASSES
---------------
RELATED CLASSES
---------------
* CNDLList:: Doubly Linked List of Objects
* CNQueueFIFO:: FIFO queue
* CNQueueLIFO:: LIFO Queue
* CNQueueRandom:: Random Queue
* CNPrioQueueFIFO:: Priority Queue
* CNSink:: Sink
* CNJob:: Standard Job for Queues
* CNStack:: Stack
DESCRIPTION
-----------
`CNQueueSPT' is a queue, implemented as a doubly linked list, that
can contain any number (well, sort of ... ;-) CNCL compatible
(restrictions see below) objects. The queueing strategy is SPT, that
means jobs with the shortest processing time are delivered first. The
processing time is read from the public identifier `length' of the
`CNJob' object. SPT queues only accept objects derived from `CNJob'.
Constructors:
`CNQueueSPT();'
`CNQueueSPT(CNParam *param);'
Initialize the SPT-queue to an empty state.
In addition to the member functions required by CNCL, `CNQueueSPT'
provides:
`virtual bool empty() const;'
Returns `TRUE', if the queue is empty.
`virtual bool full() const;'
Always returns `FALSE'.
`virtual int length() const;'
Returns the actual queue length.
`virtual void put(CNObject *obj);'
Puts an object into the queue. Only objects derived from `CNJob'
may be put into a SPT queue.
`virtual CNObject *get();'
Retrieves the object with the shortest processing time from the
queue.
`virtual CNObject *peek();'
Retrieves the object with the shortest processing time from the
queue. Unlike `get()', the object is not removed from the queue.
`virtual void delete_all();'
Deletes all objects in the queue.
File: cncl.info, Node: CNPrioQueueFIFO, Next: CNJob, Prev: CNQueueSPT, Up: Container
CNPrioQueueFIFO -- Queue with priority
======================================
SYNOPSIS
--------
`#include <CNCL/PrioQueueFIFO.h>'
TYPE
----
`CN_PRIOQUEUEFIFO'
* Menu:
BASE CLASSES
------------
* CNQueue:: Abstract queue base class
DERIVED CLASSES
---------------
RELATED CLASSES
---------------
* CNDLList:: Doubly Linked List of Objects
* CNQueueFIFO:: FIFO queue
* CNQueueLIFO:: LIFO Queue
* CNQueueRandom:: Random Queue
* CNQueueSPT:: SPT Queuecontainer
* CNSink:: Sink
* CNJob:: Standard Job for Queues
* CNStack:: Stack
DESCRIPTION
-----------
`CNPrioQueueFIFO' is a queue, implemented as some FIFO queues, that
can contain any number (well, sort of ... ;-) CNCL compatible
(restrictions see below) objects. A priority queue consists of a
number of simple FIFO queues, one for each priority. The priority value
(0 to ...) is taken from the public identifier `priority' of the
`CNJob' object. Lower values mean higher priority in access. Only
objects derived from `CNJob' are accepted.
Constructors:
`CNPrioQueueFIFO();'
`CNPrioQueueFIFO(CNParam *param);'
`CNPrioQueueFIFO(int prios);'
Initialize the priority-queue to an empty state. The `prios' value
determines the number of different priority steps for. By default
`prios' is set to two.
In addition to the member functions required by CNCL,
`CNPrioQueueFIFO' provides:
`virtual bool empty() const;'
Returns `TRUE', if all internal queues are empty.
`virtual bool full() const;'
Always returns `FALSE'.
`virtual int length() const;'
Returns the actual queue length, that means the sum of all
internal queues.
`virtual void put(CNObject *obj);'
Puts an object into the queue. Only objects derived from `CNJob'
may be put into a priority queue.
`virtual CNObject *get();'
Retrieves an object from the queue. If there are objects in more
than one internal queue the object with the lowest value in
`priority' is retrieved.
`virtual CNObject *peek();'
Retrieves an object from the queue. Unlike `get()', the object is
not removed from the queue.
`virtual void delete_all();'
Deletes all objects in the queue.
`int priorities();'
Returns the number of different prioritie steps.
File: cncl.info, Node: CNJob, Next: CNSink, Prev: CNPrioQueueFIFO, Up: Container
CNJob -- Job object
===================
SYNOPSIS
--------
`#include <CNCL/Job.h>'
TYPE
----
`CN_JOB'
* Menu:
BASE CLASSES
------------
* CNObject:: Abstract base class
DERIVED CLASSES
---------------
RELATED CLASSES
---------------
* CNQueueFIFO:: FIFO Queue
* CNQueueLIFO:: LIFO Queue
* CNQueueRandom:: Random Queue
* CNQueueSPT:: SPT Queuecontainer
* CNPrioQueueFIFO:: Priority Queue
* CNSink:: Sink
* CNStack:: Stack
DESCRIPTION
-----------
`CNJob' is a standard job object for the CNCL queues. FIFO, LIFO and
Random Queus can contain `CNJob', whereas for SPT and Priority Queues
must contain it. Users may derive objects from `CNJob' if they need
additional data. `CNJob' provides the following public member
variables which can be set/read by any user:
`CNSimTime in;'
`CNSimTime out;'
`CNSimTime start;'
`double orig_length;'
`double length;'
`int priority;'
The three time variables are used to hold the time when a job enters
a system, when a job leaves a system and when the serving begins.
`length' defines the remaining service time of a job while
`orig_length' defines its whole service time. They are equal in case of
noninterrupting queueing strategies. `priority' identifies the priority
of a job used in priority queues.
Constructors:
`CNJob();'
`CNJob(CNParam *param);'
`CNJob(double len);'
`CNJob(int prio);'
`CNJob(int prio, double len);'
Initialize the Job object, optionally setting length and/or
priority.
`CNJob' provides no additional member functions besides the one
required by CNCL.
File: cncl.info, Node: CNSink, Next: CNStack, Prev: CNJob, Up: Container
CNSink -- Kitchen Sink
======================
SYNOPSIS
--------
`#include <CNCL/Sink.h.h>'
TYPE
----
`CN_SINK'
* Menu:
BASE CLASSES
------------
* CNQueue:: Abstract queue base class
DERIVED CLASSES
---------------
RELATED CLASSES
---------------
* CNDLList:: Doubly Linked List of Objects
* CNQueueFIFO:: FIFO queue
* CNQueueLIFO:: LIFO Queue
* CNQueueRandom:: Random Queue
* CNQueueSPT:: SPT Queuecontainer
* CNPrioQueueFIFO:: Priority Queue
* CNJob:: Standard Job for Queues
* CNStack:: Stack
DESCRIPTION
-----------
`CNSink' is a data sink, implemented as queue with only an input
side. All objects which are put into this sink are destroyed there.
There is no queueing strategy.
Constructors:
`CNSink();'
`CNSink(CNParam *param);'
Initialize the Sink.
In addition to the member functions required by CNCL, `CNSink'
provides:
`virtual bool empty() const;'
Always returns `TRUE'.
`virtual bool full() const;'
Always returns `FALSE'.
`virtual int length() const;'
Returns the number of objects deleted in the queue.
`virtual void put(CNObject *obj);'
Puts an object into the queue. It will be deleted there.
`virtual CNObject *get();'
Produces an error. A sink is like a black hole.
`virtual CNObject *peek();'
Produces an error. A sink is like a black hole.
`virtual void delete_all();'
Sets the current sink to its initial state, the number of deleted
objects is set to zero.
File: cncl.info, Node: CNStack, Next: CNEvent, Prev: CNSink, Up: Container
CNStack -- Stack
================
SYNOPSIS
--------
`#include <CNCL/Stack.h>'
TYPE
----
`CN_STACK'
* Menu:
BASE CLASSES
------------
* CNQueue:: Abstract queue base class
DERIVED CLASSES
---------------
RELATED CLASSES
---------------
* CNDLList:: Doubly Linked List of Objects
* CNQueueFIFO:: FIFO queue
* CNQueueLIFO:: LIFO Queue
* CNQueueRandom:: Random Queue
* CNQueueSPT:: SPT Queuecontainer
* CNPrioQueueFIFO:: Priority Queue
* CNSink:: Sink
* CNJob:: Standard Job for Queues
DESCRIPTION
-----------
`CNStack' is a stack, implemented as a LIFO queue which can hold any
number of CNCL compatible objects. It acts very much like a LIFO queue
but provides another kind of user interface.
Constructors:
`CNStack();'
`CNStack(CNParam *param);'
`CNStack(long elem);'
Initialize the Stack, optionally setting the size.
In addition to the member functions required by CNCL, `CNStack'
provides:
`bool empty();'
Returns `TRUE' when stack is empty.
`long depth() const;'
Returns the number of objects on the stack.
`void push(CNObject *obj);'
Pushes an object onto the stack.
`CNObject *pull();'
Retrieves the last object from the stack.
`CNObject *pop();'
An alias for `pull()'. Retrieves the last object from the stack.
`void clear();'
Deletes all objects on the stack.
`long size();'
`void size(long num);'
Gets/sets the maximum depth of the stack.
File: cncl.info, Node: Events, Next: Arrays, Prev: Container, Up: Top
Event Driven Simulation
***********************
CNCL includes a set of classes for performing event driven
simulation.
For programmers convinience a script `sim.h' has been added to CNCL,
so that all necessary simulation tools are available by typing
`#include <sim.h>'. By default the heap scheduler is used, but if the
special abilities of `CNEventScheduler' are needed, your program only
needs to define `#define NO_HEAP_SCHEDULER'.
* Menu:
CNEvents
------
* CNEvent:: Generic Event
* CNEventExploder:: Send Events to multiple EventHandlers
* CNEventHandler:: Abstract Base Class for Event Handlers
* CNEventList:: List of Events
* CNEventBaseSched:: Abstract scheduler base class
* CNEventScheduler:: Event Scheduler
* CNEventHeapSched:: Event Scheduler using a heap
* CNEventIterator:: Iterate through event list
* CNSimTime:: Simulation Time
* Event Example:: Example of an Event Driven Simulation
File: cncl.info, Node: CNEvent, Next: CNEventExploder, Prev: CNStack, Up: Events
CNEvent -- Generic Event
========================
SYNOPSIS
--------
`#include <CNCL/Event.h>'
TYPE
----
`CN_EVENT'
* Menu:
BASE CLASSES
------------
* CNDLObject:: Double linked object for CNDLList
DERIVED CLASSES
---------------
RELATED CLASSES
---------------
* CNEventHandler:: Abstract Base Class for Event Handlers
* CNEventExploder:: Send Events to multiple EventHandlers
* CNEventScheduler:: Event Scheduler
* CNSimTime:: Simulation Time
DESCRIPTION
-----------
`CNEvent' is a data type for events used in the simulation. Control
is passed between different event handlers by sending events to each
other. Events have a unique ID field, a priority, a user defined type,
an issued and scheduled simulation time, an addressed event handler, a
sending event handler, and a pointer to an arbitrary CNCL object.
`CNEvent's can only be allocated on the heap via `new'.
Constructors:
`CNEvent();'
`CNEvent(CNParam *param);'
`CNEvent(int new_type);'
`CNEvent(int new_type, const CNSimTime t, int prio=0);'
`CNEvent(int new_type, CNEventHandler *new_to, const CNSimTime t, CNObject *new_object=NIL,'
`int new_prio=0);'
`CNEvent(int new_type, CNEventHandler *new_from, CNEventHandler *new_to, const CNSimTime t,'
`CNObject *new_object=NIL, int new_prio=0);'
`CNEvent(int new_type, CNEventHandler *new_to, CNObject *new_object=NIL, int new_prio=0);'
Initializes the event, optionally setting the event type, the
addressed and sending event handler, the scheduled time, the
referenced object, and the priority.
Destructors:
`~CNEvent();'
Deletes the event. The destructor is private and may only be
called from `CNEvent' itself or the friend class
`CNEventScheduler'. The destructor does NOT delete the referenced
object.
In addition to the member functions required by CNCL, `CNEvent'
provides:
`static void set_max_events(unsigned long n);'
`static unsigned long get_max_events();'
Gets/Sets maximum number of events. The default value for
`max-event' is 100. If `set_max_events()' changes this value, it
MUST be called before ANY event is created.
If more than `max-event' events are allocated, a `warning' message
is printed and the simulation continues with `max-event'
multiplied by 10.
`int priority() const;'
`void priority(int prio);'
`int get_priority() const;'
`void set_priority(int prio);'
Gets/sets the event's priority.
`int type() const;'
`void type(int new_type);'
`int get_type() const;'
`void set_type(int new_type);'
Gets/sets the event's type.
`CNSimTime scheduled() const;'
`void scheduled(const CNSimTime new_scheduled);'
`CNSimTime get_scheduled() const;'
`void set_scheduled(const CNSimTime new_scheduled);'
Gets/sets the event's scheduled simulation time.
`CNSimTime issued() const;'
`CNSimTime get_issued() const;'
Gets the event's issued simulation time.
`CNEventHandler *to() const;'
`void to(CNEventHandler *new_to);'
`CNEventHandler *get_to() const;'
`void set_to(CNEventHandler *new_to);'
Gets/sets the event's addressed event handler.
`CNEventHandler *from() const;'
`void from(CNEventHandler *new_from);'
`CNEventHandler *get_from() const;'
`void set_from(CNEventHandler *new_from);'
Gets/sets the event's sending event handler.
`CNObject *object() const;'
`void object(CNObject *obj);'
`CNObject *get_object() const;'
`void set_object(CNObject *obj);'
Gets/sets the event's referenced object.
`typedef unsigned long CNEventID;'
`CNEventID id() const;'
`CNEventID get_id() const;'
Returns the event's unique ID number.
`static void *operator new(size_t s);'
The `new' operator. It is allocating an event out of a pool
`static void operator delete(void *p);'
The `delete' operator.
`bool after(CNEvent* e2);'
Returns `TRUE' if `*this' Event is scheduled after Event `e2'. If
both Events are scheduled at the same time, the priority is
checked; after that the Event ID. This method is used by the class
`CNEventHeapSched'.
File: cncl.info, Node: CNEventExploder, Next: CNEventHandler, Prev: CNEvent, Up: Events
CNEventExploder -- Send Events to multiple EventHandlers
========================================================
SYNOPSIS
--------
`#include <CNCL/EventExploder.h>'
TYPE
----
`CN_EVENTEXPLODER'
* Menu:
BASE CLASSES
------------
* CNEventHandler:: Abstract Base Class for Event Handlers
DERIVED CLASSES
---------------
RELATED CLASSES
---------------
* CNEvent:: Generic Event
* CNEventScheduler:: CNEvent Scheduler
* CNSimTime:: Simulation Time
DESCRIPTION
-----------
`CNEventExploder' is a subclass derived from `CNEventHandler'.
It maintains a list of other arbitrary `CNEventHandler's and forwards
all received events to all the `CNEventHandler's in its list. This can
be used to implement "broadcast"-events.
Constructors:
`CNEventExploder();'
`CNEventExploder(CNParam *param);'
Initializes the event exploder.
In addition to the member functions required by CNCL,
`CNEventExploder' provides the following member functions:
`virtual void event_handler(const CNEvent *ev);'
This function receives an event and re-sends it to other
`CNEventHandler's.
`virtual void add_handler(CNEventHandler *eh);'
This function adds a new `CNEventHandler' to the list. It will then
receive all events that are send to the `CNEventExploder'.
If a `CNEventHandler' is added more than once, it will also receive
all events as many times.
`virtual void rem_handler(CNEventHandler *eh);'
This function removes a previously added `CNEventHandler' from the
list. It will no longer receive events managed by the
`CNEventExploder'.
If a `CNEventHandler' has been added more than once, it also has to
be removed as many times to be completely removed from the
`CNEventExploder'.
File: cncl.info, Node: CNEventHandler, Next: CNEventList, Prev: CNEventExploder, Up: Events
CNEventHandler -- Abstract Base Class for Event Handlers
========================================================
SYNOPSIS
--------
`#include <CNCL/EventHandler.h>'
TYPE
----
`CN_EVENTHANDLER'
* Menu:
BASE CLASSES
------------
* CNNamed:: CNObject with Name
DERIVED CLASSES
---------------
RELATED CLASSES
---------------
* CNEvent:: Generic Event
* CNEventScheduler:: CNEvent Scheduler
* CNSimTime:: Simulation Time
DESCRIPTION
-----------
`CNEventHandler' is a base class for creating simulation event
handler. Deriving an event handler class from `CNEventHandler' is
necessary for the simulation programm.
Each derived event handler must at least provide the function
`event_handler()', which is defined as pure virtual in class
`CNEventHandler'.
Constructors:
`CNEventHandler();'
`CNEventHandler(CNParam *param);'
Initializes the event handler.
`CNEventHandler(CNStringR name);'
Initializes the event handler, setting the name to `name'.
In addition to the member functions required by CNCL,
`CNEventHandler' provides the following protected member functions
available to all derived classes:
`virtual void event_handler(const CNEvent *ev) = 0;'
This function must be defined in the derived classes. It should
determine what should happen to the transfered Events. Please see
the example at the end of this chapter.
`CNEventScheduler *scheduler() const;'
Returns the scheduler, which called this event handler.
`int state() const;'
`int state(int new_state);'
`int get_state() const;'
`int set_state(int new_state);'
Gets/sets the event handler's state.
`CNSimTime now() const;'
Returns the current simulation time.
`CNEventID send_event(CNEvent *ev);'
`CNEventID send(CNEvent *ev);'
Send an event to the scheduler. Members left uninitialized in the
event are set to default values (scheduled time = current time,
addressed event handler = this event handler, sending event
handler = this event handler). Returns the event's ID.
`CNEventID send_now(CNEvent *ev);'
Send an event to the scheduler. Same as `send_event()', but
scheduled time is set to the current time. Returns the event's ID.
`CNEventID send_delay(CNEvent *ev, double dt);'
Send an event to the scheduler. Same as `send_event()', but
scheduled time is set to the current time plus a time delay dt.
Returns the event's ID.
`void delete_event(CNEventID id);'
Deletes event with ID `id' from the scheduler's event list.
`void delete_events(CNEventHandler *evh);'
Deletes all events from the list that are addressed to event
handler `evh'. If `evh' is `NIL', it deletes all events addressed
to this event handler.
File: cncl.info, Node: CNEventList, Next: CNEventBaseSched, Prev: CNEventHandler, Up: Events
CNEventList -- List of Events
=============================
SYNOPSIS
--------
`#include <CNCL/EventList.h>'
TYPE
----
`CN_EVENTLIST'
* Menu:
BASE CLASSES
------------
* CNObject:: Root of the CNCL Hierarchy
DERIVED CLASSES
---------------
RELATED CLASSES
---------------
* CNEvent:: Generic Event
* CNEventScheduler:: CNEvent Scheduler
DESCRIPTION
-----------
`CNEventList' is the list of events managed by `CNEventScheduler'.
It is a wrapper around `CNDLList' for creating a list of sorted events.
CNEvents are sorted by their scheduled time and their priority.
Constructors:
`CNEventList();'
`CNEventList(CNParam *param);'
Initializes the event list to empty.
In addition to the member functions required by CNCL, `CNEventList'
provides:
`void add_event(CNEvent *ev);'
Adds an event to the list.
`void delete_event(CNEventID id);'
Deletes an event from the list, using the ID code.
`void delete_events(CNEventHandler *evh, bool to);'
Deletes all events from the list. If `to' equals TRUE the events
addressed to event handler `evh' are deleted, else the events
coming from that event handler.
`void delete_all(CNEventID id);'
Deletes all events from the list.
`CNEvent *next_event();'
Gets the next event (the one at the front) from the list.
`CNEvent *peek_event();'
`CNEvent *peek_event(CNEventID id);'
Returns a pointer to the next scheduled event or a pointer to the
event with ID `id', `NIL' if not available.
File: cncl.info, Node: CNEventBaseSched, Next: CNEventScheduler, Prev: CNEventList, Up: Events
CNEventBaseSched -- Abstract scheduler base class
=================================================
SYNOPSIS
--------
`#include <CNCL/EventBaseSched.h>'
TYPE
----
`CN_EVENTBASESCHED'
* Menu:
BASE CLASSES
------------
* CNObject:: Root of the CNCL Hierarchy
DERIVED CLASSES
---------------
RELATED CLASSES
---------------
DESCRIPTION
-----------
Constructors:
`CNEventBaseSched();'
`CNEventBaseSched(CNParam *);'
Initializes the `CNEventBaseSched'.
In addition to the member functions required by CNCL,
`CNEventBaseSched' provides:
`CNSimTime::time();'
Returns the simulation time.
`CNStatistics *statistics() const;'
`void statistics(CNStatistics *st);'
Sets/Gets the (optional) scheduler statistic. By default no
statistic is used.
`void delete_events_from(CNEventHandler *h);'
`void delete_events_to(CNEventHandler *h);'
Deletes the events coming `from' or adressed `to' the eventhandler
`h'.
The following functions are defined virtual and must be defined in
derived classes:
`void add_event(CNEvent *ev)=0;'
`void send_event(CNEvent *ev)=0;'
Adds/sends an event to an event handler.
`void delete_event(CNEventID id)=0;'
Deletes event with ID `id'.
`void delete_events(CNEventHandler *evh, bool to=TRUE)=0;'
Deletes all events from the list that are addressed to or are
comming from event handler `evh'.
`CNEvent *peek_event()=0;'
`CNEvent *peek_event(CNEventID id)=0;'
Peeks at next event or event with ID `id'. Returns pointer to
event, or `NIL' if not available.
`CNEvent *next_event() = 0;'
Retrieves next event from internal data structure.
`void start();'
`void start(CNEvent *ev);'
Starts the scheduler with an optional initialization event.
`void stop()=0;'
Stops the scheduler after processing the current event and deletes
all pending events in the event list. May be used inside an event
handler to stop the simulation.
`CNEventIterator *create_iterator() = 0;'
Creates an event iterator.
`void process_events();'
Process all events.
`void process_now();'
Processes all events scheduled for the actual simtime..
File: cncl.info, Node: CNEventScheduler, Next: CNEventHeapSched, Prev: CNEventBaseSched, Up: Events
CNEventScheduler -- Event Scheduler
===================================
SYNOPSIS
--------
`#include <CNCL/EventScheduler.h>'
TYPE
----
`CN_EVENTSCHEDULER'
* Menu:
BASE CLASSES
------------
* CNEventBaseSched:: Abstract scheduler base class
DERIVED CLASSES
---------------
RELATED CLASSES
---------------
* CNEvent:: Generic Event
* CNEventHandler:: Abstract Base Class for Event Handlers
* CNEventList:: List of Events
* CNEventHeapSched::Faster Event Scheduler using a heap
DESCRIPTION
-----------
`CNEventScheduler' is the central simulation control. It manages the
events and delivers them to the addressed event handlers.
Scheduled events are sorted with respect to their scheduled
simulation time and their priority. If there are two or more events
with exactly the same scheduled simulation time and the same priority,
they are processed in FIFO order.
If this exact behaviour is not strictly required, if scheduled
simulation time and priority are sufficient to determine the procession
order of events, then CNEventHeapSched should be used instead of
CNEventScheduler. CNEventHeapSched avoids some potential performace
deficiencies CNEventScheduler might show.
Constructors:
`CNEventScheduler();'
`CNEventScheduler(CNParam *param);'
Initializes the event scheduler.
In addition to the member functions required by CNCL,
`CNEventScheduler' provides:
`void add_event(CNEvent *ev);'
`void send_event(CNEvent *ev);'
Adds/sends an event to an event handler.
`void delete_event(CNEventID id);'
Deletes event with ID `id'.
`void delete_events(CNEventHandler *evh, bool to=TRUE);'
Deletes all events from the list that are addressed to event
handler `evh' or that are coming from the event handler if `to'
equals FALSE.
`CNEvent *peek_event();'
`CNEvent *peek_event(CNEventID id);'
`CNEvent *next_event();'
Peeks next event or event with ID `id'. Returns pointer to event,
or `NIL' if not available.
`void stop();'
Stops the scheduler after processing the current event and deletes
all pending events in the event list. May be used inside an event
handler to stop the simulation.
`CNEventIterator *create_iterator();'
Creates an iterator object to traverse the list of events.
File: cncl.info, Node: CNEventHeapSched, Next: CNEventIterator, Prev: CNEventScheduler, Up: Events
CNEventHeapSched -- Event Scheduler using a heap
================================================
SYNOPSIS
--------
`#include <CNCL/EventHeapSched.h>'
TYPE
----
`CN_EVENTHEAPSCHED'
* Menu:
BASE CLASSES
------------
* CNEventBaseSched:: Abstract scheduler base class
DERIVED CLASSES
---------------
RELATED CLASSES
---------------
* CNEvent:: Generic Event
* CNEventHandler:: Abstract Base Class for Event Handlers
* CNEventScheduler:: Standard Event Scheduler
DESCRIPTION
-----------
`CNEventHeapSched' is a replacement for `CNEventScheduler'. From the
user's point of view, it is completely compatible, but it differs in
the internally used datastructures and algorithms.
If a high number of events is used simultaneously, the eventlist
used in `CNEventScheduler' can become very slow. `CNEventHeapSched'
solves that problem by using a more efficient algorithm, a "heap".
However there is one drawback with `CNEventHeapSched': in contrast
to `CNEventScheduler' no FIFO order of processing can be guaranteed if
events compare equal. If there are for example two or more events with
exactly the same scheduled simulation time and the same priority, then
they are processed in random order.
Constructors:
`CNEventHeapSched();'
`CNEventHeapSched(CNParam *param);'
Initializes the event scheduler.
In addition to the member functions required by CNCL,
`CNEventHeapSched' provides:
`void add_event(CNEvent *ev);'
`void send_event(CNEvent *ev);'
Adds/sends an event to an event handler.
`void delete_event(CNEventID id);'
Deletes event with ID `id'.
`void delete_events(CNEventHandler *evh, bool to=TRUE);'
Deletes all events from the list that are addressed to or are
comming from event handler `evh'.
`CNEvent *peek_event();'
`CNEvent *peek_event(CNEventID id);'
Peeks at next event or event with ID `id'. Returns pointer to
event, or `NIL' if not available.
`CNEvent *next_event();'
Gets (and removes) the next `CNEvent' from the current heap.
`void stop();'
Stops the scheduler after processing the current event and deletes
all pending events in the event list. May be used inside an event
handler to stop the simulation.
`CNEventIterator *create_iterator();'
Creates an iterator object to traverse the list of events.
File: cncl.info, Node: CNEventIterator, Next: CNSimTime, Prev: CNEventHeapSched, Up: Events
CNEventIterator -- iterate through event list
=============================================
SYNOPSIS
--------
`#include <CNCL/EventLIterator.h>' `#include <CNCL/EventHIterator.h>'
TYPE
----
`CN_EVENTLITERATOR' `CN_EVENTHITERATOR'
* Menu:
BASE CLASSES
------------
* CNObject:: Root of the CNCL Hierarchy
DERIVED CLASSES
---------------
ELATED CLASSES
---------------
* CNEvent:: Generic Event
* CNEventScheduler:: CNEvent Scheduler
* CNEventHeapSched:: HeapEventScheduler
DESCRIPTION
-----------
The classes `CNEventLIterator' and `CNEventHIterator' are used to
step through the list of events. Single events may be deleted. The
classes can only be created on the heap by calling the member function
`create_iterator' of the current scheduler.
`CNEventLIterator' and `CNEventHIterator' provide in addition to the
member functions required by CNCL:
`CNEvent *next_event();'
Returns an event every time it is called. In case the
`CNEventHeapSched' is used it can not be guaranteed that the same
event is delivered only once. Furthermore the order in which the
events are delivered needn't obey any rule. It is however
guaranteed that every event will be returned at least once.
`void delete_current_event()'
Deletes the event last returned by `next_event()'.